package homewoek12月19号.homwwork.h2;

import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

public class MainApp {
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
        Phone phone = new Phone();
        BeanUtils.setProperty(phone,"brand","小米");
        BeanUtils.setProperty(phone,"color","黑色");
        BeanUtils.setProperty(phone,"price",3000.0);
        BeanUtils.setProperty(phone,"size",6.9);




        String brand = BeanUtils.getProperty(phone, "brand");
        System.out.println(brand);
        String color = BeanUtils.getProperty(phone, "color");
        System.out.println(color);
        String price = BeanUtils.getProperty(phone, "price");
        System.out.println(price);
        String size = BeanUtils.getProperty(phone, "size");
        System.out.println(size);
    }
}
